keep if sample==1

foreach v of global all_DV { 
	display in red "`v'"
	qui reg `v' i.treatment if time==1, vce(cluster agency)
		est store `v'
	qui reg `v' i.treatment $ControlsA if time==1, vce(cluster agency)
		est store `v'_CA
	qui reg `v' i.treatment $ControlsB if time==1, vce(cluster agency)
		est store `v'_CB
}

**#Table 1

#delimit ;
global Note_Table_1 "
{\begin{minipage}{1.53\textwidth}
\small  
\vspace{0.2cm} 
\textit{Notes:} * p $math < $math 0.10, ** p $math < $math 0.05, *** p $math < $math 0.01. Standard errors clustered by agency are shown in parentheses. The dependent variable in the first three columns is the winsorized number of business days agencies took to respond (winsorized the 5\% highest values) and it only considers closed requests by November 27, 2019. Control variables in columns [2], [5], and [8] include: month in which the agency received the request, the total number of requests received by the agency before the intervention (Jan 1, 2017 until Sept. 5, 2018), the average percentage of pending requests (not past the deadline - \textit{Mean of \% Pending Pre}) before the intervention, and the average percentage of late requests prior to the intervention (\textit{Mean of \% Backlog Pre}). In addition to those, columns [3], [6], and [9] include type of requester, serial requesters, topic of the request, total number of requests received by the agency on the date request \$ i \$  arrived, and the ministry of the agency.   
 \end{minipage}
 }
";
#delimit cr

esttab business_w5 business_w5_CA business_w5_CB comply comply_CA comply_CB complete complete_CA complete_CB using "$Tables/Table_1.tex", replace  label  b(%5.3f) se(%5.3f) star(* 0.10 ** 0.05 *** 0.01) mlabels("Business Days" "Business Days" "Business Days" "Replied in time" "Replied in time" "Replied in time" "Complete answer" "Complete answer" "Complete answer") refcat(1.treatment   "\vspace{-6mm}", nolabel) stats(N r2,  labels(`"Observations"' `"R-squared"', prefix(\addlinespace[3pt])) fmt( %10.0fc %10.3fc 0 0) )  coeflabels($labels)  addnote($Note_Table_1)  keep(1.treatment 2.type_request 3.type_request 2.vex_req 3.vex_req 4.vex_req 5.vex_req 6.vex_req  pre_backlog pre_percent_not_expired _cons) order(1.treatment pre_backlog pre_percent_not_expired 2.type_request 3.type_request) nonumber nonote compress noomitted nobaselevels 

**#Table 2

#delimit ;
global Note_Table_2 "
{\begin{minipage}{1.5\textwidth}
\small  
\vspace{0.2cm} 
\textit{Notes:} * p $math < $math 0.10, ** p $math < $math 0.05, *** p $math < $math 0.01. Standard errors clustered by agency are shown in parentheses. Control variables include: month in which the agency received the request, the total number of requests received by the agency before the intervention (Jan 1, 2017 until Sept. 5, 2018), average percentage of pending requests (not past the deadline - \textit{Mean of \% Pending Pre}) before the intervention, average percentage of late requests on a date prior to the intervention (\textit{Mean of \% Backlog Pre}), type of requester, serial requesters, topic of the request, total number of requests received by the agency on the date request \$ i \$ arrived, and ministry of the agency. 

 \end{minipage}
 }
";
#delimit cr

esttab open_request_CB extension_CB business_days_within_15_CB business_days_within_25_CB business_days_15_CB business_days_25_CB  using "$Tables/Table_2.tex", tex replace  label  b(%5.3f) se(%5.3f) star(* 0.10 ** 0.05 *** 0.01) mlabels("Open request" "Extension was granted" "Within 15" "Within 25" "15 business days" "25 business days" ) refcat(1.treatment   "\vspace{-6mm}", nolabel) stats(N r2,  labels(`"Observations"' `"R-squared"', prefix(\addlinespace[3pt])) fmt( %10.0fc %10.3fc 0 0) )  coeflabels($labels)  addnote($Note_Table_2)  keep(1.treatment  2.vex_req 3.vex_req 4.vex_req 5.vex_req 6.vex_req pre_backlog pre_percent_not_expired _cons) order(1.treatment 2.vex_req 3.vex_req 4.vex_req 5.vex_req 6.vex_req pre_backlog pre_percent_not_expired)  nonumber nonote compress noomitted nobaselevels 

**#Table 3
#delimit ;
global Note_Table_3 "
{\begin{minipage}{1.32\textwidth}
\small  
\vspace{0.2cm} 
\textit{Notes:} * p $math < $math 0.10, ** p $math < $math 0.05, *** p $math < $math 0.01. Standard errors clustered by agency are shown in parentheses. Control variables in odd columns include: month in which the agency received the request, the total number of requests received by the agency before the intervention (Jan 1, 2017 until Sept. 5, 2018), the average percentage of pending requests (not past the deadline - \textit{Mean of \% Pending Pre}), and the average percentage of late requests on a date prior to the intervention (\textit{Mean of \% Backlog Pre}). In addition to those, controls in even columns also include the type of requester, serial requesters, topic of the request, total number of requests received by the agency on the date request \$ i \$ arrived, and ministry of the agency.

 \end{minipage}
 }
";
#delimit cr

esttab business_days_15_CA business_days_15_CB business_days_141516_CA business_days_141516_CB business_days_25_CA business_days_25_CB business_days_242526_CA business_days_242526_CB  using "$Tables/Table_3.tex", replace  label  b(%5.3f) se(%5.3f) star(* 0.10 ** 0.05 *** 0.01) mlabels("15 business days" "15 business days" "14/15/16 business days" "14/15/16 business days" "25 business days" "25 business days" "24/25/26 business days" "24/25/26 business days" ) refcat(1.treatment   "\vspace{-6mm}", nolabel) stats(N r2,  labels(`"Observations"' `"R-squared"', prefix(\addlinespace[3pt])) fmt( %10.0fc %10.3fc 0 0) )  coeflabels($labels)  addnote($Note_Table_3)  keep(1.treatment) nonumber nonote compress noomitted nobaselevels 



